package com.atguigu.day05;

import javax.swing.plaf.IconUIResource;
import java.util.Arrays;

public class Test04 {
    public static void main(String[] args) {
        char[] ch = new char[]{'a', 'l', 'f', 'm', 'f', 'o', 'b', 'b', 's', 'n'};
        char[] ascii = new char[62];
        for (int index = 0; index < 10; index++)
            ascii[index] = (char) ('0' + index);
        for (int index = 0; index < 26; index++)
            ascii[index + 10] = (char) ('a' + index);
        for (int index = 0; index < 26; index++)
            ascii[index + 36] = (char) ('A' + index);
//        System.out.println(Arrays.toString(ascii));
        int[] count = new int[62];
        for (int i = 0; i < ch.length; i++) {
            for (int j = 0; j < ascii.length; j++) {
                if (ch[i] == ascii[j]) {
                    count[j]++;
                }
            }
        }
        for (int i = 0; i < ascii.length; i++) {
            if (count[i] != 0)
                System.out.println(ascii[i] + "--" + count[i]);
        }
//        int[] count = new int[10];
//        for (int i = 0 ; i<ch.length;i++){
//            for (int j = i+1 ;j<ch.length-i;j++){
//                if (ch[i]==ch[j])
//                    count[i]++;
//            }
//        }
//        for (int i = 0;i<count.length;i++){
//            System.out.println(count[i]);
//        }
    }
}
